(defun our-third (x)
  (car (cdr (cdr x))))

(defun our-third (x)
  (caddr x))

(defun is-our-member(obj lst)
  (if (null lst)
    nil
    (if (eql (car lst) obj)
      lst
      (is-our-member obj (cdr lst)))))


(defun asknumber ()
  (format t "Please enter a number: ")
  (let ((x (read)))
  (if (numberp x)
    x
    (asknumber))))


;;; Iteration
;; do is basic iteration macro
;; since its macro normal exec rules do not apply
;; takes a list of variable initial and update, for example, in below loop, there is only one variable initial update element.
;; we can add as many as we want,
;; (do ( (i start (+ 1 i)) (j 10 (+ 10 j)) (k 50 ( *  k k)) )
;; then comes the condition to end and what should be returned after end. Here we are returning done as return value.
;; then there will be a list of things to be done. Here its printing the squares

(defun showsquares (start end)
  (do ((i start (+ 1 i)))
    ((> i end) 'done)
    (format t "~A ~A ~%" i (* i i))
    (format t "Manish ~%")))


;;; Apply takes a function and a number of args and applies function to args. The last one should be list
(apply #'+ '(1 2 3))
(apply #'+ 32 552 657 6889 7900  654  32 231 2 '(1 2 3))
;;; funcall  does the same thing but does not need the last arg to be list
(funcall #'+ 213  14 3 4 5 4 5 6 57 6 7)
;;
;;


